#ifndef _CVAR_H_
#define _CVAR_H_

enum
{
	CVAR_TYPE_INT,
	CVAR_TYPE_BOOL,
	CVAR_TYPE_FLOAT,
	CVAR_TYPE_STRING
};

enum
{
	//cvars that can be modified by just setting the value
	CVAR_VID_WIDTH,
	CVAR_VID_HEIGHT,
	CVAR_VID_XPOS,
	CVAR_VID_YPOS,
	CVAR_VID_BPP,
	CVAR_VID_FULLSCREEN,

	CVAR_ZBUF_MIN,
	CVAR_ZBUF_MAX,

	//cvars that must be modified by calling a function
	CVAR_FOV,

	//cvars that must not appear in the list
	CVAR_ACTIVE,
	CVAR_QUIT,
	CVAR_WND_TITLE,

	//end of list :)
	CVAR_COUNT
};

typedef struct  
{
	int type;
	union
	{
		int asInt;
		float asFloat;
		bool asBool;
		char* asString;
	};
}TCVar;

TCVar* cvar_get(int id);

int cvar_get_int(int id);
float cvar_get_float(int id);
bool cvar_get_bool(int id);
char* cvar_get_string(int id);

void cvar_set_int(int id, int var);
void cvar_set_float(int id, float var);
void cvar_set_bool(int id, bool var);
void cvar_set_string(int id, char* var);


void cvar_register();
void cvar_unregister();

#endif //_CVAR_H_
